<div id="popContainer" class="haiwi-modal">
    <div class="haiwi-modal-title">
        编  辑
    </div>
    <div class="haiwi-modal-body">
        <form id="hrmPostForm">
            <div class="input-group">
                <span class="input-group-addon">编号</span>
                <input name="id" type="text" class="form-control" value="${hrmPost.id?default(0)}" readonly="readonly">
                <span class="input-group-addon">名称</span>
                <input name="name" type="text" class="form-control" value="${hrmPost.name?default("")}">
                <span class="input-group-addon">所属部门</span>
                <input type="text" class="form-control" value="没设置">
            </div>
            <div class="input-group">
                <span class="input-group-addon">备注</span>
                <input name="remark" type="text" class="form-control" value="${hrmPost.remark?default("")}">
            </div>
        </form>
    </div>
    <div class="haiwi-modal-bottom">
        <button class="btn btn-primary" id="save-btn"">保存</button>
        <button class="btn-h28 btn-white" id="close-btn">取消</button>
    </div>
    <a href="javascript:void(0);" class="close-haiwi-modal">×</a>
    <script>
        $(function () {
            $('#close-btn').click(function () {
                $.closeHaiwiModal("popContainer");
            })
        });
        $(function () {
            $('#save-btn').click(function () {
                alert($('#hrmPostForm').serialize());
                $.ajax({
                    type: "POST",
                    url: "/Post/updatePostInfo.post",
                    data: $('#hrmPostForm').serialize(),
                    success: function (data) {
                        var result = data;
                        if (result === 1) {
                            alert("保存成功！");
                            $.closeHaiwiModal("popContainer");
                            openView("/Post/hrmPostManage.html");
                        } else {
                            alert("保存失败，请重试");
                        }
                    },
                    error: function () {
                        alert('保存出现异常');
                    }
                })
            })
        })
    </script>
</div>